﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Math.Geometry;
using FlatRedBall.Graphics;

using ROMAP.Utilities;

namespace ROMAP.Entities.Tiles
{
    public class PulsedTile : Tile
    {
        protected string filename;

        public PulsedTile(int x, int y)
        {
            TilePosition = new Vector2i(x, y);
            Initialize();
        }

        public int Tier
        {
            get;
            set;
        }

        protected override void Initialize()
        {
            /*_sprite = SpriteManager.AddSprite(CreateSprite(), "Content");
            _sprite.PixelScale();
            _sprite.ScaleX *= .5f;
            _sprite.ScaleY *= .5f;
            _sprite.AttachTo(this, false);
            _sprite.RelativeZ = 3f;

            //_sprite.AlphaRate = -0.25f;

            base.Initialize();*/

            _sprite = SpriteManager.AddSprite(CreateSprite(), "Content");
            _sprite.PixelScale();
            _sprite.ScaleX *= .5f;
            _sprite.ScaleY *= .5f;
            _sprite.AttachTo(this, false);
            _sprite.RelativeZ = .1f;

            _sprite.AlphaRate = -4;

            Tier = 0;

            base.Initialize();
        }

        protected string CreateSprite()
        {
            return @"Content/Tiles/NormalTiles/2";
        }

        public override void Activity()
        {
            if (_sprite.Alpha == 0.0f)
                Destroy();
        }

    }
}
